home *** CD-ROM | disk | FTP | other *** search
- on usequit
- set theSp to the clickOn
- puppetSound("Click")
- set the castNum of sprite theSp to 999
- updateStage()
- repeat while the stillDown
- end repeat
- set the locV of sprite 48 to 240
- updateStage()
- set theEndTime to the timer + 300
- repeat while the timer <= theEndTime
- if the mouseDown then
- exit repeat
- end if
- end repeat
- puppetSound(0)
- closeXLib()
- quit()
- end
-
- on usemenu theFName
- set theSp to the clickOn
- puppetSound("Click")
- set the castNum of sprite theSp to 998
- updateStage()
- repeat while the stillDown
- end repeat
- set the castNum of sprite theSp to 994
- updateStage()
- puppetSound(0)
- go(theFName)
- end
-
- on usehelp
- set theSp to the clickOn
- puppetSound("Click")
- set the castNum of sprite theSp to 997
- updateStage()
- repeat while the stillDown
- end repeat
- set the castNum of sprite theSp to 993
- updateStage()
- puppetSound(0)
- end
-
- on useinfo
- set theSp to the clickOn
- puppetSound("Click")
- set the castNum of sprite theSp to 996
- updateStage()
- repeat while the stillDown
- end repeat
- puppetSound(0)
- go("Info")
- end
-
- on ResetAllPuppets
- repeat with e = 1 to 48
- puppetSprite(e, 0)
- end repeat
- end
-
- on DialogwithMouse
- if not rollOver(27) then
- beep()
- dontPassEvent()
- end if
- end
-
- on BuildPrinterTitle
- global gNowMode
- set the castNum of sprite 7 to cast gNowMode
- set the locV of sprite 7 to 54
- updateStage()
- puppetSprite(7, 1)
- end
-
- on BuildArtButtons
- global gPageNumber, gTableL, gTotalPage
- set gPageNumber to 1
- set theCount to count(gTableL)
- set gTotalPage to GetNumOfPages(theCount)
- UpdateArtButtons()
- puppetSprite(26, 1)
- puppetSprite(34, 1)
- puppetSprite(35, 1)
- end
-
- on GetNumOfPages theTotalEntry
- set theRepCount to 1
- set theNowEntrys to theTotalEntry
- repeat while the maxinteger
- set theNowEntrys to theNowEntrys - 6
- if theNowEntrys <= 0 then
- exit repeat
- next repeat
- end if
- set theRepCount to theRepCount + 1
- end repeat
- return theRepCount
- end
-
- on UpdateArtButtons
- global gPageNumber, gTableL, gTotalPage
- if gTotalPage >= 2 then
- if gPageNumber = 1 then
- set the locV of sprite 34 to 1000
- set the locV of sprite 35 to 240
- else
- if gPageNumber = gTotalPage then
- set the locV of sprite 34 to 240
- set the locV of sprite 35 to 1000
- else
- set the locV of sprite 34 to 240
- set the locV of sprite 35 to 240
- end if
- end if
- else
- set the locV of sprite 34 to 1000
- set the locV of sprite 35 to 1000
- end if
- set theCount to count(gTableL)
- set theHList to "282,385,489,282,385,489"
- set theVList to "106,106,106,238,238,238"
- repeat with e = 1 to 6
- set theE to ((gPageNumber - 1) * 6) + e
- set the locV of sprite (e + 19) to 1000
- if theCount >= theE then
- set theCastName to item 4 of getAt(gTableL, theE)
- set the castNum of sprite (e + 19) to cast theCastName
- set the locH of sprite (e + 19) to value(item e of theHList)
- set the locV of sprite (e + 19) to value(item e of theVList)
- end if
- puppetSprite(e + 19, 1)
- end repeat
- updateStage()
- end
-
- on ClickPageSlider
- global gPageNumber
- puppetSound("Click")
- if the clickOn = 34 then
- set the castNum of sprite 34 to cast "PREV_BU.H"
- updateStage()
- repeat while the stillDown
- end repeat
- set gPageNumber to gPageNumber - 1
- set the castNum of sprite 34 to cast "PREV_BU"
- else
- set the castNum of sprite 35 to cast "NEXT_BU.H"
- updateStage()
- repeat while the stillDown
- end repeat
- set gPageNumber to gPageNumber + 1
- set the castNum of sprite 35 to cast "NEXT_BU"
- end if
- updateStage()
- UpdateArtButtons()
- end
-
- on ResetArtButtons
- set thePuppetList to "20,21,22,23,24,25,26,34,35"
- repeat with e = 1 to 9
- set theSp to value(item e of thePuppetList)
- set the locV of sprite theSp to 1000
- puppetSprite(theSp, 0)
- end repeat
- updateStage()
- end
-
- on ClickArtButton
- global gTableL, gTargetPRNfile, gTargetDLGcast, gTargetTEXTcount, gMachineType, gTargetTEXTprn, gPageNumber, gTotalPage
- puppetSound("Click")
- set theHList to "282,385,489,282,385,489"
- set theVList to "106,106,106,238,238,238"
- set theSp to the clickOn
- set the locH of sprite 26 to value(item theSp - 19 of theHList)
- set the locV of sprite 26 to value(item theSp - 19 of theVList)
- updateStage()
- repeat while the stillDown
- end repeat
- set thep to theSp - 19 + ((gPageNumber - 1) * 6)
- set theTargetData to getAt(gTableL, thep)
- set gTargetPRNfile to item 2 of theTargetData
- set gTargetDLGcast to item 3 of theTargetData
- set gTargetTEXTcount to value(item 5 of theTargetData)
- if gMachineType = "PC" then
- if gTargetTEXTcount >= 2 then
- go("Dialog-1")
- else
- if gTargetTEXTcount = 1 then
- set gTargetTEXTprn to char 1 to 3 of gTargetPRNfile & "_1"
- go("Dialog-2")
- else
- set gTargetTEXTprn to EMPTY
- go("Dialog-2")
- end if
- end if
- else
- set gTargetTEXTprn to EMPTY
- go("Dialog-2")
- end if
- puppetSound(0)
- end
-
- on BuildTEXTDialog
- global gTargetTEXTcount, gTargetPRNfile, gTargetTEXTprn
- set theVList to "196,223,250"
- repeat with e = 1 to gTargetTEXTcount
- set theCastName to char 1 to 3 of gTargetPRNfile & "_" & string(e)
- set the castNum of sprite (27 + e) to cast theCastName
- set the locV of sprite (27 + e) to value(item e of theVList)
- puppetSprite(e + 27, 1)
- end repeat
- set gTargetTEXTprn to char 1 to 3 of gTargetPRNfile & "_1"
- set the locV of sprite 31 to 196
- puppetSprite(31, 1)
- updateStage()
- set the mouseDownScript to "DialogwithMouse"
- end
-
- on ResetTEXTDialog
- repeat with e = 28 to 31
- set the locV of sprite e to 1000
- puppetSprite(e, 0)
- end repeat
- updateStage()
- end
-
- on ClickTEXTDialog
- global gTargetPRNfile, gTargetTEXTprn
- set theVList to "196,223,250"
- set theSp to the clickOn
- set the locV of sprite 31 to value(item theSp - 27 of theVList)
- updateStage()
- set gTargetTEXTprn to char 1 to 3 of gTargetPRNfile & "_" & theSp - 27
- end
-
- on BuildPageDialog
- global gTargetDLGcast
- put "1" into field 32
- set the castNum of sprite 31 to cast gTargetDLGcast
- set the locV of sprite 31 to 240
- puppetSprite(31, 1)
- updateStage()
- set the mouseDownScript to "DialogwithMouse"
- end
-
- on ResetPageDialog
- set the locV of sprite 31 to 1000
- puppetSprite(31, 0)
- updateStage()
- end
-
- on ClickPageDialog
- global gnumberofpages, gMachineType
- puppetSound("Click")
- set the castNum of sprite 30 to 30
- updateStage()
- repeat while the stillDown
- end repeat
- if field 32 <> EMPTY then
- set thenewnumber to field 32
- set theNum to the number of chars in thenewnumber
- set theresult to "Success"
- repeat with e = 1 to theNum
- if "0123456789" contains char e of thenewnumber then
- nothing()
- next repeat
- end if
- set theresult to "Error"
- exit repeat
- end repeat
- if theresult = "Error" then
- alert("Error!!" & RETURN & "code : bad format.")
- put gnumberofpages into field 32
- set the castNum of sprite 30 to 9
- updateStage()
- puppetSound(0)
- else
- set thenumber to value(thenewnumber)
- if thenumber = 0 then
- alert("Error!!" & RETURN & "code : number of pages minimum number is 1.")
- put gnumberofpages into field 32
- set the castNum of sprite 30 to 9
- updateStage()
- puppetSound(0)
- else
- set gnumberofpages to thenumber
- puppetSound(0)
- set the mouseDownScript to EMPTY
- go("Dialog-3M")
- end if
- end if
- else
- alert("Please type number of pages.")
- put gnumberofpages into field 32
- set the castNum of sprite 30 to 9
- updateStage()
- puppetSound(0)
- end if
- end
-
- on PrintSetUp
- global gTargetPRNfile, gTargetTEXTprn, gNowMode, gnumberofpages, gMachineType, gDebugMode
- set the castNum of sprite 27 to cast (gNowMode & "_PDLG")
- set the locV of sprite 27 to 140
- puppetSprite(27, 1)
- updateStage()
- set theErrorFlag to 0
- if gDebugMode = 0 then
- set theChObj to fileio(mnew, "read", the pathName & gTargetPRNfile)
- if not objectp(theChObj) then
- alert("Sorry! not found PRNfile." & RETURN & "file :" && gTargetPRNfile)
- set theErrorFlag to 1
- else
- theChObj(mdispose)
- end if
- if gTargetTEXTprn <> EMPTY then
- set theChObj to fileio(mnew, "read", the pathName & gTargetTEXTprn)
- if not objectp(theChObj) then
- alert("Sorry! not found second PRNfile." & RETURN & "file :" && gTargetTEXTprn)
- set theErrorFlag to 1
- else
- theChObj(mdispose)
- end if
- end if
- end if
- if theErrorFlag = 1 then
- set the locV of sprite 26 to 1000
- set the locV of sprite 27 to 1000
- puppetSprite(27, 0)
- updateStage()
- go("Home")
- else
- put "1/" & string(gnumberofpages) into field "PrintPageInfo"
- end if
- end
-
- on PrintEngine
- global gTargetPRNfile, gTargetTEXTprn, gnumberofpages, gMachineType, gDebugMode, gNowMode, gTargetTEXTcount, gTargetDLGcast, gTableL, gxfname
- if gMachineType = "PC" then
- set gxfname to "MJPRINT.DLL"
- else
- set gxfname to "PRNXlib"
- end if
- if InitialPort() <> EMPTY then
- ClosePrintEngine()
- else
- repeat with e = 1 to gnumberofpages
- if gDebugMode = 1 then
- set theInfoStr to "Machine/Table/TotalPRN :" && gMachineType & "/" & gNowMode & "/" & string(count(gTableL)) & RETURN & "MainPRN/SubPRN :" && gTargetPRNfile & "/" & gTargetTEXTprn & RETURN & "SubEntrys/PaperInfoCASTname :" && string(gTargetTEXTcount) & "/" & gTargetDLGcast & RETURN & "ActivePage/TotalPage :" & string(e) & "/" & string(gnumberofpages)
- alert(theInfoStr)
- else
- if SendPrintData() = "EXIT" then
- exit repeat
- end if
- end if
- if e <> gnumberofpages then
- puppetSound("Central Park 22k 30")
- set the castNum of sprite 29 to 51
- set the castNum of sprite 31 to 53
- set the locV of sprite 29 to 279
- set the locV of sprite 31 to 279
- updateStage()
- set theEndTime to the timer + 900
- set theDialogRes to "NEXT"
- repeat while the timer <= theEndTime
- if the mouseDown = 1 then
- set theDialogRes to InterceptPrint()
- if theDialogRes <> EMPTY then
- exit repeat
- end if
- end if
- end repeat
- set the locV of sprite 29 to 1000
- set the locV of sprite 31 to 1000
- updateStage()
- if theDialogRes = "CANCEL" then
- exit repeat
- end if
- puppetSound(0)
- put string(e + 1) & "/" & string(gnumberofpages) into field "PrintPageInfo"
- end if
- end repeat
- puppetSound(0)
- ClosePrintEngine()
- end if
- end
-
- on InterceptPrint
- if rollOver(28) then
- if rollOver(29) then
- set the castNum of sprite 29 to 52
- updateStage()
- return "CANCEL"
- else
- if rollOver(31) then
- set the castNum of sprite 31 to 54
- updateStage()
- return "NEXT"
- else
- return EMPTY
- end if
- end if
- else
- beep()
- return EMPTY
- end if
- end
-
- on ClosePrintEngine
- global gPrintObj, gxfname
- set the locV of sprite 27 to 1000
- set the locV of sprite 26 to 1000
- puppetSprite(27, 0)
- if objectp(gPrintObj) then
- gPrintObj(mdispose)
- end if
- closeXLib(the pathName & gxfname)
- updateStage()
- end
-
- on InitialPort
- global gPrintObj, gMachineType, gxfname
- if objectp(gPrintObj) then
- gPrintObj(mdispose)
- end if
- if gMachineType = "PC" then
- openXLib(the pathName & gxfname)
- set gPrintObj to MJPRINT(mnew)
- if not objectp(gPrintObj) then
- alert("Sorry can't initial port.")
- return "Error"
- end if
- return EMPTY
- else
- openXLib(the pathName & gxfname)
- return EMPTY
- end if
- end
-
- on SendPrintData
- global gPrintObj, gEjectSct, gTargetPRNfile, gMachineType
- if gMachineType = "PC" then
- if gPrintObj(mPrint, the pathName & gTargetPRNfile) <> 0 then
- alert("Sorry! not found PRNfile." & RETURN & "file :" && gTargetPRNfile)
- set theresult to "EXIT"
- else
- set theresult to EMPTY
- end if
- else
- if macprintmj(the pathName & gTargetPRNfile) <> 0 then
- alert("Sorry! not found PRNfile." & RETURN & "file :" && gTargetPRNfile)
- set theresult to "EXIT"
- else
- set theresult to EMPTY
- end if
- end if
- return theresult
- end
-